package com.oop.demo03;

public class Pet {
    public String name;//public权限
    public int age;

    public void shout(){
        System.out.println("叫了一声");
    }
}

/*
    public static void main(String[] args) {

        Pet dog = new Pet();//需public 定义属性
        dog.name = "皮皮";
        dog.age = 3;
        dog.shout();

        System.out.println(dog.name);
        System.out.println(dog.age);

        Pet cat = new Pet();


    }
 */